<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HELLO WORD</title>
</head>
<body>
<h3>Hello Word</h3>
<!-- <input type="button" value="下载excle文档" onclick="downLoadFile()">
<br>
<input type="text" id="userName" name="userName" value="输入用户名">
<input type="button" value="查询信息" onclick="queryUserInfo()">
 -->
<br>
<div>
<form action="" id="downLoadFile">
<input type="button" value="下载excle文档" onclick="downLoadFile()">
</form>
</div>
<div>
<form action="" id="checkNameIno">
<input type="text" id="userName" name="userName" value="输入用户名">
<input type="button" value="查询信息" onclick="queryUserInfo()">
</form>
</div>

<div id="upload" align="center">
<form action="/uploadFile" id="uploadFile" method="post" enctype="multipart/form-data">
	<table>
		<tr>
			<td>
				文件1：<input id="file1" name="file1"  type="file">
			</td>
			<td>
				文件2：<input id="file2" name="file2"  type="file">
			</td>
			<td>
				文件3：<input id="file3" name="file3"  type="file">
			</td>
			<td>
				<input type="button" value="上传文档" onclick="uploadFile()">
			</td>
		</tr>
	</table>
</form>
</div>
<!-- <input type="file" name="file" id="file" enctype="multipart/form-data">
<input type="button" value="上传文档" onclick="uploadFile()"> -->
</body>
<script src="/js/jquery-3.4.0.js"></script>
<script type="text/javascript">
/**
 * 下载excle
 */
function downLoadFile(){
	window.open("downLoadPOI");
}
/**
 * 上传文档
 */
function uploadFile(){
	var file=$("#file")[0].files;
	console.log(file);
	$.ajax(
			{
				type:"post",
				url:"/uploadFile",
				contentType: false,
				processData: false,
				data:{file:file},
				success:function (data){
					console.log(data);
					alert(data)
				}
			});
}
/**
 * 查询信息
 */
function queryUserInfo(){
	var userName=$("#userName").val();
	$.ajax(
			{
				type:"post",
				url:"/getUserInfo",
				dataType:"json",
				data:{name:userName},
				success:function (data){
					
					console.log(data);
				}
			});
}

</script>
</html>

